﻿<EnumSelect TEnum="Province" OnSelectedItemChanged="handleChange" />
<br />
<br />
<EnumSelect TEnum="Fruits?" @bind-Value="_value" Mode="SelectMode.Multiple" />

Flags Enum Value: @Convert.ToUInt64(_value), @_value.ToString()

@using System.ComponentModel.DataAnnotations
@code {

    Fruits? _value = Fruits.Apple | Fruits.Pear;

    void handleChange(Province province)
    {
        Console.WriteLine(province);
    }

    public enum Province
    {
        [Display(Name = nameof(Resources.App.Shanghai), ResourceType = typeof(Resources.App))]
        Shanghai,
        [Display(Name = nameof(Resources.App.Zhejiang), ResourceType = typeof(Resources.App))]
        Zhejiang,
        [Display(Name = nameof(Resources.App.Jiangsu), ResourceType = typeof(Resources.App))]
        Jiangsu
    }

    [Flags]
    public enum Fruits
    {
        Apple = 1,

        Pear = 2,

        Orange = 4
    }
}
